package ws.utils.collections.table;

/**
 * HTML representation of the row.
 *
 * @author Wilson Santos, 36228 <wilson.santos@ua.pt>
 */
public class RowHTML extends Row {

  /**
   * Create new instance from other row.
   *
   * @param row other row.
   */
  public RowHTML(Row row) {
    for (Column col : row.columnList) {
      addColumn(new ColumnHTML(col));
    }
  }

  /**
   * Get HTML representation of this row.
   *
   * @return HTML code.
   */
  @Override
  public String toString() {
    String html = "<tr>\n";

    for (Column col : columnList) {
      html += col.toString();
    }

    html += "  </tr>\n";
    return html;
  }
}
